//
//  YXCustomCollectionViewCell.m
//  YXImageBrowserDemo
//
//  Created by guo peng huang on 2021/5/19.
//

#import "YXCustomCollectionViewCell.h"
#import "YXCustomData.h"

@interface YXCustomCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *textLabel;

@end

@implementation YXCustomCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.contentView.backgroundColor = UIColor.whiteColor;
}

#pragma mark - <YBIBCellProtocol>

@synthesize yx_cellData = _yx_cellData;
@synthesize yx_hideBrowser = _yx_hideBrowser;

- (void)setYx_cellData:(id<YXDataProtocol>)yx_cellData {
    _yx_cellData = yx_cellData;
    YXCustomData *data = (YXCustomData *)yx_cellData;
    self.textLabel.text = data.text;
}

#pragma mark - touch

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesEnded:touches withEvent:event];
    self.yx_hideBrowser();
}

@end
